package com.lobstar.xrpc.server.listener;

import com.lobstar.xrpc.common.listener.ErrorListener;
import com.lobstar.xrpc.common.listener.RequestListener;
import com.lobstar.xrpc.common.listener.ResponseListener;

public class ServerListeners {

	private OnlineListener onlineListener;
	private OfflineListener offlineListener;

	private ErrorListener errorListener;
	public OnlineListener getOnlineListener() {
		if(onlineListener == null) {
			onlineListener = DefaultServiceListener.online();
		}
		return onlineListener;
	}
	public void setOnlineListener(OnlineListener onlineListener) {
		this.onlineListener = onlineListener;
	}
	public OfflineListener getOfflineListener() {
		if(offlineListener == null) {
			offlineListener = DefaultServiceListener.offline();
		}
		return offlineListener;
	}
	public void setOfflineListener(OfflineListener offlineListener) {
		this.offlineListener = offlineListener;
	}
	public ErrorListener getErrorListener() {
		return errorListener;
	}
	public void setErrorListener(ErrorListener errorListener) {
		this.errorListener = errorListener;
	}

	public static ServerListeners defaultListeners() {
		return new ServerListeners();
	}

}
